﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Model
{
    [DataContract]
    public class SalesLineItem
    {
        [DataMember]
        private int quantity;
        [DataMember]
        private Seat seat;

        public SalesLineItem(int quantity, Seat seat)
        {
            Quantity = quantity;
            Seat = seat;
        }

        public SalesLineItem()
        {

        }

        public int Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }

        [DataMember]
        public double SubTotal
        {
            get { return this.seat.Event.Price - seat.Discount * this.quantity; }
        }

        [DataMember]
        public Seat Seat
        {
            get { return this.seat; }
            set { this.seat = value; }
        }
    }
}
